<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<%@ page import="com.agileai.domain.DataRow"%>
<%@ page import="java.util.*"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>缺陷统计</title>
<script type="text/javascript" src="js/FusionCharts_pc.js"></script>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<link rel="stylesheet" href="css/icon.css" type="text/css" />
</head>

<script language="javascript">
function clickTestScheme(testSchemeId,projectId){
	$('#PT_ID').val(testSchemeId);
	$('#PI_ID').val(projectId);
	doSubmit({actionType:'prepareDisplay'});
}
</script>

<style type="text/css">
.datalistmenu{
	overflow-x:hidden; 
	overflow-y:scroll; 
	border:1px solid #005BAC; 
	height:600px; 
	width:18%;
	padding:2px;
	margin-top:3px;
	float: left;
}
.datalistmenu a{
	line-height:22px;
	font-size:14px;
	color:black;
	text-decoration: none; 
	display:block;
}
.datalistmenu a{
	padding-left:10px;
	font-size: 12px;
    color: #222;
    line-height: 30px;
    height: 30px;
    width: 100%;
    display: inline-block;
}
.datalistmenu tr td{
	line-height:30px;
	font-family: Verdana, Geneva, sans-serif;
	border-bottom: 1px #B6D2F9 solid;
	text-align: -webkit-left;
    padding-left: 10px;
}
.datalistmenu tr td:hover{
	line-height: 30px;
	color:navy;
	background-color:#E5EFFD;
	position:relative;
}
.datalistmenu tr td.selected{
	font-weight:bold;
	background-color: #B6D2F9;
}
.datalistmenu tr td.selected a{color: #FFF;}
.title{
	line-height:30px;
	color: #FFF;
	background-color: #005BAC;
}
.chart{
	width:80%;
	padding:2px;
	float: left;
}
.form_css{
	margin-top: 10px;
}
</style>

<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>
<div><!-- 最外层div-->
<div class="datalistmenu"><!-- 左侧列表 -->
<table width="100%" cellspacing="1" cellpadding="1">
	<tr>
		<th class="title">测试方案</th>
	</tr>
	 <%
	  List<DataRow> testSchemeNameRecords = (List)pageBean.getAttribute("testSchemeNameRecords");
	  for (int i=0;i < testSchemeNameRecords.size();i++){
		  DataRow row = testSchemeNameRecords.get(i);
	%>
		<tr style="<%=row.get("css") %>">
			<td onclick="clickTestScheme('<%=row.get("PT_ID") %>','<%=row.get("PI_ID") %>' )"  >
				<%=row.get("PT_NAME") %>
			</td>
	    </tr>
	<%} %> 
	<input id="PT_ID" name="PT_ID" type="hidden" value="<%=pageBean.inputValue("PT_ID")%>" />
	<input id="PI_ID" name="PI_ID" type="hidden" value="<%=pageBean.inputValue("PI_ID")%>" />
</table>
</div>
<div class="chart"><!-- 统计图 -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td width="50%"><div id="projectDefectStatChart" align="center" style="height:270px;padding:1px;"></div></td>
	<td width="50%"><div id="eliminatRateStatChart" align="center" style="height:270px;padding:1px;"></div></td>	
  </tr>
</table>

<div class="form_css"><!-- 表格 -->
<ec:table 
form="form1"
var="row"
items="pageBean.rsList" csvFileName="投票分项.csv"
retrieveRowsCallback="process" xlsFileName="投票分项.xls"
useAjax="true" sortable="true"
doPreload="false" toolbarContent="navigation|pagejump |pagesize |export|extend|status"
width="100%" rowsDisplayed="15"
listWidth="100%" 
height="296px"
>
<ec:row styleClass="odd" oncontextmenu="selectRow(this,{VVIE_ID:'${row.VVIE_ID}'});refreshConextmenu()" onclick="selectRow(this,{VVIE_ID:'${row.VVIE_ID}'})">
	<ec:column width="50" style="text-align:center" property="_0" title="序号" value="${GLOBALROWCOUNT}" />
	<ec:column width="100" property="PF_NAME" title="功能名称"   />
	<ec:column width="100" property="PF_DEFECTNUM" title="总数量"   />
	<ec:column width="100" property="PF_COMPLETENUM" title="已完成数量"   />
	<ec:column width="100" property="PF_NOCOMPLETENUM" title="未完成数量"   />
	<ec:column width="100" property="ELIMINATRATE" title="消缺率"   />
	<ec:column width="100" property="PF_CHARGE" title="负责人"   />
	<ec:column width="100" property="PF_MODIFYNUM" title="修改次数"   />
</ec:row>
</ec:table>
</div>

</div>
</div>
<input type="hidden" name="actionType" id="actionType" value=""/>
</form>
</body>
</html>
<script type="text/javascript">
$(function(){
	var __loadActiveMfStatChart = function(){
		var chart = new FusionCharts("<%=request.getContextPath()%>/charts/Column3D.swf","activeMfStat","100%","100%", "0", "0","FFFFFF", "exactFit");
		var url = "<%=pageBean.getHandlerURL()%>&actionType=projectDefectXml&chartType=projectDefectChart&testSchemeId="+$("#PT_ID").val()+"&projectId="+$("#PI_ID").val();
		sendRequest(url,{dataType:'text',onComplete:function(responseText){
			chart.setDataXML(responseText);
			chart.render("projectDefectStatChart");
		}});
	};
	__loadActiveMfStatChart();
	
	var __loadDullMfStatChart = function(){
		var chart = new FusionCharts("<%=request.getContextPath()%>/charts/Column3D.swf","activeMfStat","100%","100%", "0", "0","FFFFFF", "exactFit");
		var url = "<%=pageBean.getHandlerURL()%>&actionType=projectDefectXml&chartType=eliminatRateChart&testSchemeId="+$("#PT_ID").val()+"&projectId="+$("#PI_ID").val();
		sendRequest(url,{dataType:'text',onComplete:function(responseText){
			chart.setDataXML(responseText);
			chart.render("eliminatRateStatChart");
		}});
	};
	__loadDullMfStatChart();
});
</script>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
